home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-02-28 | 3.2 KB | 110 lines | [TEXT/MPS ] |
- // Copyright ©1993-94 Apple Computer, Inc. All rights reserved.
- constant kAppSymbol := '|Drawing:PIEDTS|;
- // ---- End Project Data ----
-
-
- // ---- File Draw.t ----
- _view000 :=
- {title: "Drawing Examples",
- viewBounds: {left: -1, top: 0, right: 236, bottom: 325},
- viewDrawScript:
- func()
- begin
- :DrawMe(); // just draw all the shapes
- end,
- myLine: nil,
- myRect: nil,
- myRoundRect: nil,
- myOval: nil,
- myWedge: nil
- ,
- myPolygon: nil,
- myShape: nil,
- myRegion: nil,
- myPict: nil,
- myText: nil,
- myScaledPict: nil,
- myStyle: nil,
- DrawMe:
- func()
- begin
- /* There are two ways to pass shapes to DrawShape, either
- individual shape objects, or all of them inside an Array.
- We show both techniques in this sample.
-
- :DrawShape(myLine, myStyle);
- :DrawShape(myRect, myStyle);
- :DrawShape(myRoundRect, myStyle);
- :DrawShape(myOval, myStyle);
- :DrawShape(myWedge, myStyle);
- :DrawShape(myPolygon, myStyle);
- :DrawShape(myRegion, myStyle);
- :DrawShape(myPict, myStyle);
- :DrawShape(myText, myStyle);
- :DrawShape(myScaledPict, myStyle);
- */
- :DrawShape([myLine, myRect, myRoundRect, myOval, myWedge,
- myPolygon, myRegion, myPict, myText, myScaledPict],
- myStyle);
-
- end,
- viewSetupDoneScript:
- func()
- begin
- // Create all the example shape objects.
- myLine := MakeLine(0,0, 20, 20);
- myRect := MakeRect(0,30,20,50);
- myRoundRect := MakeRoundRect(0, 60, 20, 80, 10);
- myOval := MakeOval(0, 90, 20, 110);
- myWedge := MakeWedge(0, 120, 20, 140, 0, 90);
- myPolygon := MakePolygon([0, 150, 20, 170, 20, 150]);
-
- local rectangle := MakeRect(0, 210, 30, 230);
- local oval := MakeOval(0, 220, 30, 240);
- myRegion := MakeRegion([rectangle, oval,]);
- myText := MakeText("Bob", 0, 250, 55, 270);
- myPict := MakePict([myLine, myRect, myRoundRect, myOval, myWedge,
- myPolygon, myRegion, myText], myStyle);
-
- // Do the PICT thing, adjust the PICT resource to the pict shape object.
- OffsetShape(myPict, 40, 5);
- myScaledPict := DeepClone(myPict);
- local startRect := ShapeBounds(myScaledPict);
- local endRect := {left: 80, top: 10, right: 150, bottom: 150,};
- ScaleShape(myScaledPict, startRect, endRect);
- end,
- viewSetupFormScript:
- func()
- begin
- local a := GetAppParams();
- self.viewBounds := RelBounds(a.appAreaLeft, a.appAreaTop, a.appAreaWidth, a.appAreaHeight);
- end,
- _proto: protoApp
- };
-
- _view001 := /* child of _view000 */
- {viewFlags: 545,
- viewFormat: 0,
- viewBounds: {left: 122, top: 18, right: 234, bottom: 138},
- viewClickScript:
- func(unit)
- begin
- // We will lock the screen, do the drawing, and unlock
- // the screen.
- :LockScreen(true);
- :DoDrawing('DrawMe, nil);
- // :DrawMe(); // Don't do it this way, won't set up clipping etc.
- :LockScreen(nil);
- end,
- viewclass: 74
- };
-
-
-
-
-
-
-
- // ---- Beginning of section for non used Layout files ----
-
- // End of output